/*
 * @Author: your name
 * @Date: 2021-11-13 15:51:04
 * @LastEditTime: 2021-11-17 09:27:12
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \li-yuwei\admin\src\api\classify\index.js
 */
import request from "../../utils/request";
//获取知识小册数据
function getKnowledgeList(data) {
    return request({
        url: "/api/knowledge",
        method: "post",
        data,
    });
}
//添加知识小册数据
function addKnowledgeList(data) {
    return request({
        url: "/api/add/knowledge",
        method: "post",
        data,
    });
}

//删除知识小册
function delKnowledgeList(data) {
    return request({
        url: "/api/knowledge",
        method: "delete",
        data,
    });
}
//编辑知识小册
function editKnowledgeList(data) {
    return request({
        url: "/api/knowledge",
        method: "put",
        data,
    });
}
//改变线上状态
function changeKnowledgeState(data) {
    return request({
        url: "/api/alter/knowledge",
        method: "put",
        data,
    });
}
//一级详情
function getKnowledgeDetail(id) {
    return request({
        url: `/api/knowledge/${id}`,
        method: "get",
    });
}
//获取二级内容
function getKnowledgeChildren(id) {
    return request({
        url: `/api/child/knowledge/${id}`,
        method: "get",
    });
}
//添加二级内容
function addKnowledgeChildren(data) {
    return request({
        url: `/api/child/add`,
        method: "post",
        data,
    });
}
export default {
    getKnowledgeList,
    addKnowledgeList,
    delKnowledgeList,
    editKnowledgeList,
    changeKnowledgeState,
    getKnowledgeDetail,
    getKnowledgeChildren,
    addKnowledgeChildren,
};